package com.p2p.controller.operationsManagement;

import com.p2p.common.base.RespResult;
import com.p2p.entity.NewcomerStrategy;
import com.p2p.service.operationsManagementService.NewcomerStrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/newComerStrategy")
public class NewcomerStrategyController {

    @Autowired
    private NewcomerStrategyService newcomerStrategyService;

    /**
     * 新人活动策略展示
     * @return
     */
    @GetMapping(value = "/findNewcomerStrategyList")
    @ResponseBody
    public RespResult findNewcomerStrategyList(){

        return newcomerStrategyService.findNewcomerStrategyList();
    }

    /**
     * 根据id修改新人策略
     * @param newcomerStrategy
     * @return
     */
    @PostMapping(value = "/updateNewcomerStrategy")
    @ResponseBody
    public RespResult updateNewcomerStrategy(@RequestBody NewcomerStrategy newcomerStrategy){

        return newcomerStrategyService.updateNewcomerStrategy(newcomerStrategy);
    }
}
